<?php
/*------------------------------------------------------------------------
# company - quota management 
# @author    pipapai.com by mawei
-------------------------------------------------------------------------*/
defined('_JEXEC') or die;
// disable core styles to avoid bs conflict 
OC_Util::$core_styles = array();

if(isDevMode()) {
   OCP\Util::addStyle('company', 'quota');
   OCP\Util::addScript('company', 'quota');
} else {
   OCP\Util::addStyle('static', 'company');
   OCP\Util::addScript('static', 'apps/company.quota.min');
}


OCP\App::setActiveNavigationEntry('company_settings');

$lang = PFactory::getLanguage();
$lang->load("com_jobs", JPATH_SITE, "zh-CN");

$userQuota = PCompanyHelper::getUserQuota();
if(isset($userQuota['email_sms_settings']['email_jobstatus_weekly'])){
   $jobstatus_week_array=explode(',',$userQuota['email_sms_settings']['email_jobstatus_weekly']);
}else{
   $jobstatus_week_array=array();
}
?>

<script type="text/javascript" src="<?php print_unescaped(OC_Helper::linkTo('company/js', 'company.php'));?>"></script>

<div class="hr_inner_navigate clearfix">
   <ul class="clearfix">
      <?php PCompanyHelper::showNavigationMenu($_['masteruser'], 'emailsms');?>
   </ul>
</div>

<form id="emailSmsSettingForm" action="<?=OC_Helper::linkTo('company','ajax/saveemailsmssettings.php')?>" method="POST" autocomplete="off">
<div class="hr_valueaddbox">
   <div class="valueaddtablebox">
   	  <table width="100%" cellpadding="0" cellspacing="0" border="0">
      	 <tr class="emailsms_tr">
         	<th width="50%"><span>短信设置</span></th>
            <th width="50%"><span>邮件设置</span></th>
         </tr>
         <tr>
         	<td valign="top" style="padding-left:100px;">
         	   <div class="lavemessagetip"><span>你的短信还剩余<?=$userQuota['sms_left']?>条</span><a target="_blank" href="<?=OC_Helper::linkToRoute('company_quota')?>">立即购买</a></div>
         	   <div class="sendsetting_eachbox medium clearfix">
               	  <b class="pull-left">线上邀请：<br/><span>（完善信息、笔试评测）</span></b>
                  <div class="pull-left">
                  	 <label class="checkbox">
                        <input type="checkbox" name="email_sms_settings[sms_onlineinterview_0h]" value="1" <?=(!empty($userQuota['email_sms_settings']['sms_onlineinterview_0h']) ? 'checked' : '')?>>
                        邀请邮件发出同时，发送短信
                     </label>
                     <label class="checkbox">
                        <input type="checkbox" name="email_sms_settings[sms_onlineinterview_48h]" value="1" <?=(!empty($userQuota['email_sms_settings']['sms_onlineinterview_48h']) ? 'checked' : '')?>>
                        邀请48小时无反馈，发送短信提醒
                     </label>
                  </div>
               </div>
               <div class="sendsetting_eachbox medium clearfix">
                  <b class="pull-left">面试通知：</b>
                  <div class="pull-left">
                  	 <label class="checkbox">
                        <input type="checkbox" name="email_sms_settings[sms_offlineinterview_0d]" value="1" <?=(!empty($userQuota['email_sms_settings']['sms_offlineinterview_0d']) ? 'checked' : '')?>>
                        面试邮件发出同时，发送短信
                     </label>
                     <label class="checkbox">
                        <input type="checkbox" name="email_sms_settings[sms_offlineinterview_1d]" value="1" <?=(!empty($userQuota['email_sms_settings']['sms_offlineinterview_1d']) ? 'checked' : '')?>>
                        面试前一天，发送短信提醒
                     </label>
                  </div>
               </div>
               <div class="sendsetting_eachbox medium clearfix">
               	<b class="pull-left">入职通知：</b>
                  <div class="pull-left">
                  	<label class="checkbox">
                        <input type="checkbox" name="email_sms_settings[sms_offer_0d]" value="1" <?=(!empty($userQuota['email_sms_settings']['sms_offer_0d']) ? 'checked' : '')?>>
                        offer发出同时，发送短信
                     </label>
                     <label class="checkbox">
                        <input type="checkbox" name="email_sms_settings[sms_offer_1d]" value="1" <?=(!empty($userQuota['email_sms_settings']['sms_offer_1d']) ? 'checked' : '')?>>
                        入职前一天，发送短信提醒
                     </label>
                  </div>
               </div>
			</td>
            <td valign="top" style="padding-left:100px;">
               <div class="sendsetting_eachbox medium clearfix">
                  <b class="pull-left" style="width:130px; margin-left:-30px;">职位动态发送设置：</b>
                  <div class="pull-left">
                     <label class="checkbox">
                        <input type="checkbox" name="email_sms_settings_jobstatus[]" value="1" <?=(in_array('1', $jobstatus_week_array) ? 'checked' : '')?>>
                        每周一发送
                     </label>
                     <label class="checkbox">
                        <input type="checkbox" name="email_sms_settings_jobstatus[]" value="2" <?=(in_array('2', $jobstatus_week_array) ? 'checked' : '')?>>
                        每周二发送
                     </label>
                     <label class="checkbox">
                        <input type="checkbox" name="email_sms_settings_jobstatus[]" value="3" <?=(in_array('3', $jobstatus_week_array)  ? 'checked' : '')?>>
                        每周三发送
                     </label>
                     <label class="checkbox">
                        <input type="checkbox" name="email_sms_settings_jobstatus[]" value="4" <?=(in_array('4', $jobstatus_week_array)  ? 'checked' : '')?>>
                        每周四发送
                     </label>
                     <label class="checkbox">
                        <input type="checkbox" name="email_sms_settings_jobstatus[]" value="5" <?=(in_array('5', $jobstatus_week_array)  ? 'checked' : '')?>>
                        每周五发送
                     </label>
                     <label class="checkbox">
                        <input type="checkbox" name="email_sms_settings_jobstatus[]" value="6" <?=(in_array('6', $jobstatus_week_array)  ? 'checked' : '')?>>
                        每周六发送
                     </label>
                     <label class="checkbox">
                        <input type="checkbox" name="email_sms_settings_jobstatus[]" value="0" <?=(in_array('0', $jobstatus_week_array)  ? 'checked' : '')?>>
                        每周日发送
                     </label>
                  </div>
               </div>
               <div class="sendsetting_eachbox medium clearfix">
                  <b class="pull-left">职位动态内容：</b>
                  <div class="pull-left" style="width:320px;">
                     <label class="checkbox">
                        <input type="checkbox" name="email_sms_settings[email_jobsaved]" value="1" <?=(!empty($userQuota['email_sms_settings']['email_jobsaved']) ? 'checked' : '')?>>
                        仅发送收藏职位的动态 <em style="color:#999999;">(取消勾选将发送全部职位动态)</em>
                     </label>
                  </div>
               </div>
               <div class="sendsetting_eachbox medium clearfix">
                  <b class="pull-left">面试提醒：</b>
                  <div class="pull-left">
                     <label class="checkbox">
                        <span>面试当天会发送提醒邮件给面试官</span><br/>
                        <input type="checkbox" name="email_sms_settings[email_remind_event_owner]" value="1" <?=(!empty($userQuota['email_sms_settings']['email_remind_event_owner']) ? 'checked' : '')?>>
                        同时发送提醒邮件给安排面试者
                     </label>
                  </div>
               </div>
            </td>
         </tr>
      </table>
      
      <div class="sendsetting_btnbox sendsettingwrap" style="text-align:center;"><span class="server settingmsg"></span><a href="javascript:;" class="ppp_bluebtn send_surebtn">确认</a></div>
   </div>
</div>
</form>

<input type="hidden" name="requesttoken" value="<?php echo $_['requesttoken'] ?>" id="requesttoken">

